package com.li.springboard.controller;
import com.li.springboard.pojo.Student;
import com.li.springboard.service.impl.StudentServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
* (student)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/student")
public class StudentController {
/**
* 服务对象
*/
@Resource
private StudentServiceImpl studentServiceImpl;

/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("selectOne")
public Student selectOne(Integer id) {
return studentServiceImpl.selectByPrimaryKey(id);
}

@GetMapping("selectByAll")
public List<Student> selectByAll(Student student){
    return studentServiceImpl.selectByAll(student);
}
}
